package com.zys.hotel_management.utils;

import com.zys.hotel_management.entity.Customer;

/**
 * @Author:Soyo
 * @Description:
 * @Create: 2025/5/24
 */


public class UserContext {
    private static final ThreadLocal<Customer> USER_HOLDER = new ThreadLocal<>();

    public static void setUser(Customer user) {
        USER_HOLDER.set(user);
    }

    public static Customer getUser() {
        return USER_HOLDER.get();
    }

    public static void clear() {
        USER_HOLDER.remove();
    }
}